-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 #313
Conversation
…rs can edit migration to jsonb if needed.
Readd support for delays |
Woop woop!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a few thoughts on this from earlier this week I forgot to post. Curious for your take, @excid3! 🙏
@@ -0,0 +1,9 @@ | |||
module Noticed | |||
class ApplicationJob < ActiveJob::Base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we called it out anywhere, but this gem does have a hard dependence on ActiveJob 🤔 I know there are plenty of apps out there using Sidekiq directly (for example), so this may be worth noting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add an explicit require for it if needed. Could also replace the dependency on Rails with ActiveRecord + ActiveJob.
return false if config.has_key?(:if) && !evaluate_option(:if) | ||
return false if config.has_key?(:unless) && evaluate_option(:unless) | ||
|
||
deliver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I wish there was a way to wrap this in with_lock
and ensure that this particular [notification, delivery_method]
hasn't already sent. I've definitely had cases where someone got multiple messages sent due to a retrying job. I know ultimately it boils down to never truly being able to sync up the web/email POST (or etc) with the database's state... but just wanted to throw it out there!
IIRC we're not retrying jobs anyway, so maybe it's not a big deal!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long-term we can add the ability for storing the results of delivery methods on the Noticed::Notification so the delivery methods can check if they were completed already before they run.
This introduced a new major version of Noticed with some big improvements.
record{polymorphic}
association to Notification model to improve querying ergonomics.NotificationRecipient
model to reduce data duplication.http
gem dependency and replace with net/http